home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Applications
/
Audio
/
Patchmix
/
XWindowsSource
/
nutree.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-03-28
|
1KB
|
89 lines
static char rcsid[] = "$Header: nutree.c,v 1.2 90/10/11 10:31:40 mara Exp $";
/*
* nutree.c
*
* Written by Mara Helmuth
*
* Description: N-ary tree classes for Cmix X graphical interface
*
* $Log: nutree.c,v $
* Revision 1.2 90/10/11 10:31:40 mara
* *** empty log message ***
*
* Revision 1.1 90/08/27 17:09:21 mara
* Initial revision
*
*
*/
#include "plus.h"
tree::tree(int s, int out_ugen)
{
root = 0;
size = s;
root = new t_node;
root->contents = out_ugen;
insert(root);
}
void tree::insert(t_node* parent)
{
t_node* child;
child = get_child(parent);
if(child)
insert(child);
else
;
/* if(child == lastchild)
printf("now do nutree ugen %d\n",parent->contents);
*/
// process the ugen
}
t_node* tree::get_child(t_node* p)
{
t_node* child = new t_node;
switch(ugen[p->contents].type) {
case OSCIL: {
switch(p->index) {
case 0: {
child->contents = ugen[p->contents].oscil->amp->in_ugen;
return child;
break;
}
break;
}
}
}
return 0;
}
void tree::clear(t_node* n,int first)
{
/*
t_node* current;
if (first) {
current = root;
first = 0;
root = 0;
}
else
current = n;
if (current != 0) {
clear(current -> left,first);
clear(current -> right,first);
if (current) {
delete current;
}
}
*/
}